<?php
class Phat_am extends CI_Controller{
	function __construct(){
		parent::__construct();
	}
	
	function index($id = NULL){
		if($id){
			$row = $this->db->select()->from("phat_am")->where("id", $id)->get()->row();
		}
		else{
			$row = $this->db->select()->from("phat_am")->get()->row();
		}
		
		redirect('/article/13', 'location', 301);
		$others = $this->db->from("phat_am")->where("id <>",$row->id)->order_by("id","asc")->get()->result();
		$data["others"] = $others;
		//print_r($row);
		$data["row"] = $row;
		$this->load->view("phat_am/index", $data);
	}
}